package com.JohnCarloSalter.BackEnd;

public class CMD_SubmitOrder implements CommandInterface {

	private Aggregator aggregator;
	private int itemNumber;
	
	public CMD_SubmitOrder(Aggregator a, int item) {
		aggregator = a;
		itemNumber = item;
	}
	
	public Boolean execute() {
		try {
			aggregator.getOrders().addOrder(itemNumber);
		} catch(Exception eRef) {
			System.err.println("Error: Item does not exist on our menu.");
			return false;
		}
		return true;
		
	}

}
